// 变量定义
$primary-color: #165dff;
$secondary-color: #36cfc9;
$success-color: #00b42a;
$warning-color: #ff7d00;
$danger-color: #f53f3f;
$neutral-color: #f5f7fa;
$neutral-dark: #1d2129;
$text-color: #4e5969;
$text-color-light: #86909c;
$border-color: #e5e6eb;
$bg-color: #f5f7fa;

// 间距变量
$spacing-xs: 4px;
$spacing-sm: 8px;
$spacing-md: 12px;
$spacing-lg: 16px;
$spacing-xl: 24px;
$spacing-xxl: 32px;

// 圆角变量
$radius-sm: 4px;
$radius-md: 6px;
$radius-lg: 8px;
$radius-xl: 12px;

// 阴影变量
$shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
$shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
$shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.08);
$shadow-hover: 0 6px 24px rgba(0, 0, 0, 0.12);

// 字体大小变量
$font-size-xs: 12px;
$font-size-sm: 14px;
$font-size-md: 16px;
$font-size-lg: 18px;
$font-size-xl: 24px;
$font-size-xxl: 32px;

// 全局样式重置
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  min-height: 100%;
}

// 自定义滚动条样式
* {
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: #888 #f1f1f1; /* Firefox */
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
  
  &:hover {
    background: #555;
  }
}

// 布局相关
.layout-container {
  min-height: 100vh;
  display: flex;
  background-color: $bg-color;
}

// 页面内容区域
.page-container {
  flex: 1;
  padding: $spacing-xl;
  overflow-y: auto; // 允许垂直滚动
  overflow-x: hidden; // 隐藏横向滚动
  background-color: $bg-color;
  height: 100%; // 确保有固定高度才能滚动
}

.page-header {
  margin-bottom: $spacing-xl;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  .header-left {
    flex: 1;
  }

  .header-right {
    display: flex;
    gap: $spacing-md;
    align-items: center;
  }
}

.page-title {
  font-size: $font-size-xl;
  font-weight: 600;
  color: $neutral-dark;
  margin: 0;
}

.page-description {
  font-size: $font-size-sm;
  color: $text-color-light;
  margin-top: $spacing-sm;
}


// 卡片样式
.card-shadow {
  box-shadow: $shadow-lg;
}

.stat-card {
  background: white;
  border-radius: $radius-xl;
  padding: $spacing-xl;
  box-shadow: $shadow-lg;
  transition: all 0.3s ease;

  &:hover {
    box-shadow: $shadow-hover;
    transform: translateY(-2px);
  }
}

.stat-number {
  font-size: $font-size-xxl;
  font-weight: 700;
  color: $neutral-dark;
  margin: $spacing-sm 0;
}

.stat-label {
  font-size: $font-size-sm;
  color: $text-color-light;
  margin-bottom: $spacing-sm;
}

.stat-trend {
  font-size: $font-size-xs;
  display: flex;
  align-items: center;
  gap: $spacing-xs;

  &.up {
    color: $success-color;
  }

  &.down {
    color: $danger-color;
  }
}

// 表格样式增强
.arco-table {
  border-radius: $radius-lg;
  overflow: hidden;
}

.arco-table-thead {
  background-color: #f7f8fa;
}

.arco-table-th {
  font-weight: 600;
  color: $neutral-dark;
}

// 按钮组样式
.action-buttons {
  display: flex;
  gap: $spacing-sm;
  align-items: center;
}

.action-button {
  padding: $spacing-xs $spacing-sm;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: $radius-sm;
  transition: all 0.2s ease;

  &:hover {
    background-color: #f2f3f5;
  }

  &.primary {
    color: $primary-color;

    &:hover {
      background-color: #e6f4ff;
    }
  }

  &.warning {
    color: $warning-color;

    &:hover {
      background-color: #fff7e6;
    }
  }

  &.danger {
    color: $danger-color;

    &:hover {
      background-color: #ffece8;
    }
  }
}

// 状态标签
.status-tag {
  padding: 2px $spacing-sm;
  border-radius: $radius-xl;
  font-size: $font-size-xs;
  font-weight: 500;

  &.available {
    background-color: #e8f8e8;
    color: $success-color;
  }

  &.occupied {
    background-color: #ffece8;
    color: $danger-color;
  }

  &.reserved {
    background-color: #e6f4ff;
    color: $primary-color;
  }

  &.maintenance {
    background-color: #fff7e6;
    color: $warning-color;
  }
}

// 响应式设计
// 大屏幕 (>1440px)
@media (min-width: 1441px) {
  .page-container {
    max-width: 1600px;
    margin: 0 auto;
  }
}

// 中等屏幕 (1024px - 1440px)
@media (max-width: 1440px) {
  .page-container {
    padding: $spacing-lg;
  }
}

// 平板 (768px - 1024px)
@media (max-width: 1024px) {
  .page-container {
    padding: $spacing-md;
  }

  .page-header {
    flex-direction: column;
    gap: $spacing-md;
    
    .header-right {
      width: 100%;
      justify-content: flex-start;
    }
  }

  .page-title {
    font-size: 22px;
  }
}

// 手机 (<768px)
@media (max-width: 768px) {
  .page-container {
    padding: $spacing-md;
  }

  .page-header {
    flex-direction: column;
    gap: $spacing-sm;
    
    .header-right {
      width: 100%;
      flex-wrap: wrap;
    }
  }

  .page-title {
    font-size: 20px;
  }

  .page-description {
    font-size: 12px;
  }

  .stat-card {
    padding: $spacing-md;
  }

  .stat-number {
    font-size: $font-size-xl;
  }
}

// 小手机 (<480px)
@media (max-width: 480px) {
  .page-container {
    padding: $spacing-sm;
  }

  .page-title {
    font-size: 18px;
  }

  .stat-card {
    padding: $spacing-sm;
  }

  .stat-number {
    font-size: $font-size-lg;
  }
}

// 加载动画
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

// 空状态
.empty-state {
  text-align: center;
  padding: 48px $spacing-xl;
  color: $text-color-light;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: $spacing-lg;
  opacity: 0.5;
}

.empty-state-text {
  font-size: $font-size-md;
  margin-bottom: $spacing-sm;
}

.empty-state-description {
  font-size: $font-size-sm;
  opacity: 0.7;
}

// Arco Design 样式覆盖
:deep(.arco-card) {
  border-radius: $radius-xl;
  box-shadow: $shadow-lg;
}

:deep(.arco-btn) {
  border-radius: $radius-md;
}

:deep(.arco-input) {
  border-radius: $radius-md;
}

:deep(.arco-select) {
  border-radius: $radius-md;
}

